package com.blobfish.fiction.common.repo;

import us.codecraft.webmagic.Site;
import us.codecraft.webmagic.model.ConsolePageModelPipeline;
import us.codecraft.webmagic.model.OOSpider;
import us.codecraft.webmagic.model.annotation.ExtractBy;
import us.codecraft.webmagic.model.annotation.TargetUrl;

/**
 * 无极小说下载model
 *
 * @author blobfish
 */
@TargetUrl("https://m\\.wujixiaoshuo\\.com/\\w+/\\w+")
public class WujixiaoshuoRepo {
    @ExtractBy("//header[@id=\"top\"]/span/text()")
    private String title;
    @ExtractBy("//div[@id=\"chaptercontent\"]/tidyText()")
    private String value;

    public static void main(String[] args) {
        OOSpider.create(Site.me().setSleepTime(1000), new ConsolePageModelPipeline(),
                WujixiaoshuoRepo.class).addUrl("https://m.wujixiaoshuo.com/22_22018/all.html").run();
    }
}
